package com.dongpl.constant;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

public class Result implements Serializable {

    private static final String SUCCESS = "success";

    private static final String FAILED = "failed";

    private static final int SUCCESS_CODE = 200;

    private static final int FAILED_CODE = 403;

    public static String success(String msg){
        Map<String, Object> map = new HashMap<>();
        map.put("code",SUCCESS_CODE);
        map.put("status",SUCCESS);
        map.put("msg",msg);
        return map.toString();
    }

    public static String failed(String msg){
        Map<String, Object> map = new HashMap<>();
        map.put("code",FAILED_CODE);
        map.put("status",FAILED);
        map.put("msg",msg);
        return map.toString();
    }

}
